/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: javase202202 - Op1
 * <p>Powered by Lisi On 2022-05-27 11:44:12
 * <p>Created by IntelliJ IDEA
 *

 * @version 1.0
 * @since 17
 */
public class Op1 {
    public static void main(String[] args) {
        //算术运算符 + - * / % ++ --
        System.out.println(3 + 2 - 1 + 15 * 6 / 2);
        System.out.println(6 / 3);
        System.out.println(6 / 3.0);
        System.out.printf("%.3f%n", 6 / 3.0);

        System.out.println(3 / 2);//整商
        System.out.println(3 % 2);//余数


        int i = 3; //声明变量i 并赋值3 i = 3
        int n = ++i; //声明变量n 并赋值 ++i  i=4  n=4
        i += 2;//i = i + 2; i = 6
        n = n + 2; //n = 6
        System.out.println(++i); //7
        System.out.println(i);//7
        System.out.println(n--);//输出6，再n-- 执行此代码，n的值为5
        System.out.println(n);//5
    }
}
